import React from 'react';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import rootReducer from './global-state-context.reducer';

function GlobalStateProvider(props: React.PropsWithChildren) {
  const { children } = props;
  const store = createStore(rootReducer);
  return <Provider store={store}>{children}</Provider>;
}

export default GlobalStateProvider;
